﻿#include"state.h"
#include<stdio.h>
#include<string.h>

int main(){
	char b[MAX_COMMAND_LENGTH];
	int stackSize, price;
	printf("Parking Management System by so,fc,liu.\nEnter help for more information.\n\n");
	printf("Init...\nEnter the scale of parking lot: ");
	scanf("%d", &stackSize);
	initStack(&stop, stackSize);
	initStack(&tmp, stackSize);
	printf("Enter the price per hour: ");
	scanf("%d", &price);
	initq(&sidewalk);
	getchar();
	printf("\n");
	while(1){
		printf("$:");
	    gets(b);
		if(strcmp(b, "help") == 0){
			printf("show parking       Show cars in the parking lot\n"
				"show sidewalk      Show cars in the sidewalk\n\n");
		}
		else if(strcmp(b, "show parking") == 0)
			showStop();
		else if(strcmp(b, "exit") == 0)
			exit(0);
		else if (strcmp(b, "show sidewalk") == 0 || strcmp(b, "show sideWalk") ==0)
			showSidewalk(sidewalk);
		else rs(b, price);
	}	
}